bitkeeper revision 1.1159.212.31 (41f52831-7xkHV9BTxL0wcBF2Ad-aQ)
authormafetter@fleming.research <mafetter@fleming.research>
Mon, 24 Jan 2005 16:54:09 +0000 (16:54 +0000)
committermafetter@fleming.research <mafetter@fleming.research>
Mon, 24 Jan 2005 16:54:09 +0000 (16:54 +0000)
Added a minor amount of hypercall argument validation to do_boot_vcpu()
Signed-off-by: michael.fetterman@cl.cam.ac.uk
xen/common/domain.c

index 70f8d0060f100ff4bce85f9d3565956e2e880846..8709630cd4daf5a0e0b6fe0c117f4f26e2de5a1e 100644 (file)
@@ -305,8 +305,8 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt)
     int rc = 0;
     full_execution_context_t *c;
 
-    if ( d->exec_domain[vcpu] != NULL )
-        return EINVAL;
+    if ( (vcpu >= MAX_VIRT_CPUS) || (d->exec_domain[vcpu] != NULL) )
+        return -EINVAL;
 
     if ( alloc_exec_domain_struct(d, vcpu) == NULL )
         return -ENOMEM;